Repository navigation
Add automation group and Copilot task status tools - #3859
Open
A-Georgiou wants to merge 2 commits into
Open
A-Georgiou wants to merge 2 commits into
A-Georgiou wants to merge 2 commits into
Conversation
|
|
||
| type copilotTaskSessionError struct { | ||
| Code *string `json:"code,omitempty"` | ||
| Message *string `json:"message,omitempty"` |
A-Georgiou
force-pushed
the
a-georgiou/automation-task-status
branch
from
November 16, 2026 01:30
197f417 to
6673d8f
Compare
| func automationGroupResult(output map[string]any) (*mcp.CallToolResult, json.RawMessage, error) { | ||
| response, err := json.Marshal(output) | ||
| if err == nil { | ||
| response, err = sanitizeAutomationNames(response) |
Base automatically changed from
shaikhul-public-automation-mcp-stack
to
main
November 16, 2026 12:36
| if !ok { | ||
| return utils.NewToolResultError("Automation confirmation response is invalid. The operation was not performed."), nil | ||
| } | ||
| if confirmation.Action != "accept" { |
| return utils.NewToolResultErrorFromErr("failed to read GitHub agent automations response", err), nil, nil | ||
| } | ||
| } | ||
| sanitizedResponse, err := sanitizeAutomationNames(response) |
A-Georgiou
force-pushed
the
a-georgiou/automation-task-status
branch
from
November 30, 2026 04:10
6673d8f to
9510884
Compare
| if add { | ||
| method = http.MethodPut | ||
| } | ||
| return newAgentAutomationTool[AutomationGroupMembershipInput]( |
| if status.Sessions == nil { | ||
| status.Sessions = []copilotTaskSessionStatus{} | ||
| } | ||
| return json.Marshal(status) |
A-Georgiou
marked this pull request as ready for review
November 30, 2026 04:45
A-Georgiou
force-pushed
the
a-georgiou/automation-task-status
branch
from
November 30, 2026 04:57
9510884 to
aa7e6c3
Compare
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The new group and task-status tools omit IFC labels even when enabled, leaving private automation data and untrusted session errors without classifications used by client information-flow controls.
5 open issues
What changed in this PR
Extends the opt-in copilot_automations toolset with five automation-group tools and a Copilot task-status reader, continuing the move toward a shared public implementation.
Changes:
- Adds group discovery, creation, and version-checked membership updates.
- Adds task-status output containing selected metadata without prompts, transcripts, or events.
- Updates registration, tests, schema snapshots, coverage exemptions, and generated documentation.
| File | Description |
|---|---|
| README.md | Adds groups to the toolset description. |
| pkg/skills/catalog/availability_test.go | Exempts the six tools from bundled skill coverage. |
| pkg/http/handler_test.go | Verifies group writes remain available without request-state protection. |
| pkg/github/tools.go | Registers six tools and updates toolset metadata. |
| pkg/github/copilot_task_status.go | Implements task validation and status projection. |
| pkg/github/copilot_task_status_test.go | Tests projection and invalid task handling. |
| pkg/github/agent_automations.go | Adds multi-request execution and response-projection hooks. |
| pkg/github/agent_automations_test.go | Extends shared automation tests to the new tools. |
| pkg/github/agent_automation_groups.go | Implements group operations, pagination, and membership checks. |
| pkg/github/agent_automation_groups_test.go | Tests group requests, membership changes, and input validation. |
| pkg/github/__toolsnaps__/remove_automation_from_group.snap | Records the membership-removal schema. |
| pkg/github/__toolsnaps__/list_automation_groups.snap | Records the group-listing schema. |
| pkg/github/__toolsnaps__/get_copilot_task_status.snap | Records the task-status schema. |
| pkg/github/__toolsnaps__/get_automation_group.snap | Records the group-read schema. |
| pkg/github/__toolsnaps__/create_automation_group.snap | Records the group-creation schema. |
| pkg/github/__toolsnaps__/add_automation_to_group.snap | Records the membership-addition schema. |
| docs/remote-server.md | Updates the remote toolset description. |
| docs/feature-flags.md | Documents the six feature-gated tools and their inputs. |
Review effort: Max (adaptive)
Comment on lines
+185
to
+186
| if request.execute != nil { | ||
| return request.execute(ctx, client) |
Comment on lines
+261
to
+270
| groups, response, err := listAutomationGroupPages(ctx, client, path, "tags", nil) | ||
| if err != nil { | ||
| return ghErrors.NewGitHubAPIErrorResponse(ctx, unconfirmed, response, err), nil, nil | ||
| } | ||
| for _, group := range groups { | ||
| if group["id"] == created.ID { | ||
| return automationGroupResult(map[string]any{"status": "created", "group": group}) | ||
| } | ||
| } | ||
| return utils.NewToolResultError(unconfirmed), nil, nil |
Comment on lines
+73
to
+74
| method: http.MethodGet, | ||
| path: "agents/tasks/" + args.TaskID, |
Comment on lines
+75
to
+76
| project: func(response json.RawMessage) (json.RawMessage, error) { | ||
| return projectCopilotTaskStatus(args.TaskID, response) |
Comment on lines
+94
to
+96
| if status.Sessions == nil { | ||
| status.Sessions = []copilotTaskSessionStatus{} | ||
| } |
Port the hosted Copilot Automation group tools to the public automation tags REST API: list_automation_groups, get_automation_group, create_automation_group, add_automation_to_group and remove_automation_from_group. The tools join the copilot_automations toolset behind the agent_automations feature flag. Like create, update and run, the group mutations have no confirmation step, so clients without form elicitation can list and call them; only delete_automation keeps one. They are excluded in read-only mode and reject unknown arguments. Membership changes first confirm the live group and membership version, and adding refuses to move an automation that already references another group. Membership reads use the published is_tag_membership_included parameter, kept in one constant. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: f921ed41-2ec0-4075-a572-7692f9529b7e Copilot-Session: 86b2b275-fbfe-4bb3-90b6-4c44fa0989f4
Port the hosted get_copilot_task_status tool onto the public GET /agents/tasks/{task_id} endpoint. It returns the same metadata-only snapshot as the hosted tool, without prompts or other session content.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: f921ed41-2ec0-4075-a572-7692f9529b7e
Copilot-Session: 86b2b275-fbfe-4bb3-90b6-4c44fa0989f4
A-Georgiou
force-pushed
the
a-georgiou/automation-task-status
branch
from
November 30, 2026 05:11
3de6aec to
fa9ae60
Compare
| ) | ||
| } | ||
|
|
||
| func automationGroupMembershipTool(t translations.TranslationHelperFunc, add bool, name, title, description string, annotations mcp.ToolAnnotations) inventory.ServerTool { |
| if err != nil { | ||
| return ghErrors.NewGitHubAPIErrorResponse(ctx, "failed to list automation group members", response, err), nil, nil | ||
| } | ||
| return automationGroupResult(map[string]any{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Summary
Adds the remaining hosted Copilot Automation tools to the public MCP server: five automation group tools (
list_automation_groups,get_automation_group,create_automation_group,add_automation_to_group,remove_automation_from_group) andget_copilot_task_status. Samecopilot_automationstoolset andagent_automationsflag as #3719, and the group writes follow #3867: no confirmation step, onlydelete_automationkeeps one.Why
Completes the open-source port of the hosted
copilot_automationstoolset for github/sweagentd#16692. It supersedes #3561, #3562 and #3563, using the hosted tool names (*_automation_group*) instead of tag names and adding the add/remove membership tools.Before the hosted server uses these tools:
copilot_mission_control_public_automation_grouping_apirollout; github/github#474389 adds the GHE.com routes. github/github-mcp-server-remote#1111 migrates OSS automation tools by name, so the hosted server must not pin this change before then.get_copilot_task_statusmatches the hosted CAPI version's limits (4 MiB upstream response, 100 sessions, 256 KiB of metadata), or the hosted cutover keeps that tool on CAPI.What changed
list_automation_groups: GET/automation-tags, all pages; a 403, 404 or 503 returnsgroupingAvailable: falsewith the error, like the hosted tool.get_automation_group: GET/automation-tags/{tag_id}, then lists member automations withtag_idandis_tag_membership_included=true, all pages.create_automation_group: POST/automation-tagswith a freshidempotency_key, then reads the new group to confirm the result.add_automation_to_groupandremove_automation_from_group: read the group and the automation's membership, then PUT or DELETE/automations/{automation_id}/tags/{tag_id}withexpected_tag_membership_version. They keep the hosted no-op detection and refuse to move an automation that already has a group.get_copilot_task_status: GET/agents/tasks/{task_id}; requires a hyphenated UUID, rejects a response for a different task or with missing or duplicate task and session fields, and returns task and session IDs, states, timestamps and recorded errors without prompts or other session content.executehook for operations that need several requests and a response projection hook. Like create, update and run, the group writes have no confirmation step and stay listed without request-state protection; every new tool rejects unknown arguments.Differences from the hosted tools: inputs keep the hosted
group_idname (RESTtag_id);expected_identity/identityare not supported, like the other OSS automation writes;groupUrlandartifactStorageNoticeare omitted because the public API has no web URL or public tag storage endpoints.MCP impact
copilot_automationstoolset description now mentions groups.agent_automationsenabled; read-only mode keeps the three read tools.Prompts tested (tool changes only)
delete_automationneeds form elicitation.tag_idmember filter withis_tag_membership_included). No live write was performed.Security / limits
get_copilot_task_statushas no scope gate because the task endpoint authorizes the caller, matching the hosted tool.Tool renaming
deprecated_tool_aliases.goNote: if you're renaming tools, you must add the tool aliases. For more information on how to do so, please refer to the official docs.
Lint & tests
./script/lint: passed../script/test: passed (go test -race ./...).script/generate-docsleaves no drift.Docs